3.1.14 \(\int \csc ^2(c+d x) (a+a \sec (c+d x)) \, dx\) [14]

3.1.14.1 Optimal result
3.1.14.2 Mathematica [C] (verified)
3.1.14.3 Rubi [A] (verified)
3.1.14.4 Maple [A] (verified)
3.1.14.5 Fricas [A] (verification not implemented)
3.1.14.6 Sympy [F]
3.1.14.7 Maxima [A] (verification not implemented)
3.1.14.8 Giac [A] (verification not implemented)
3.1.14.9 Mupad [B] (verification not implemented)

3.1.14.1 Optimal result

Integrand size = 19, antiderivative size = 37 \[ \int \csc ^2(c+d x) (a+a \sec (c+d x)) \, dx=\frac {a \text {arctanh}(\sin (c+d x))}{d}-\frac {a \cot (c+d x)}{d}-\frac {a \csc (c+d x)}{d} \]

output
a*arctanh(sin(d*x+c))/d-a*cot(d*x+c)/d-a*csc(d*x+c)/d
 
3.1.14.2 Mathematica [C] (verified)

Result contains higher order function than in optimal. Order 5 vs. order 3 in optimal.

Time = 0.16 (sec) , antiderivative size = 41, normalized size of antiderivative = 1.11 \[ \int \csc ^2(c+d x) (a+a \sec (c+d x)) \, dx=-\frac {a \cot (c+d x)}{d}-\frac {a \csc (c+d x) \operatorname {Hypergeometric2F1}\left (-\frac {1}{2},1,\frac {1}{2},\sin ^2(c+d x)\right )}{d} \]

input
Integrate[Csc[c + d*x]^2*(a + a*Sec[c + d*x]),x]
 
output
-((a*Cot[c + d*x])/d) - (a*Csc[c + d*x]*Hypergeometric2F1[-1/2, 1, 1/2, Si 
n[c + d*x]^2])/d
 
3.1.14.3 Rubi [A] (verified)

Time = 0.42 (sec) , antiderivative size = 35, normalized size of antiderivative = 0.95, number of steps used = 16, number of rules used = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.789, Rules used = {3042, 4360, 25, 25, 3042, 25, 3317, 25, 3042, 3101, 25, 262, 219, 4254, 24}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \csc ^2(c+d x) (a \sec (c+d x)+a) \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {a-a \csc \left (c+d x-\frac {\pi }{2}\right )}{\cos \left (c+d x-\frac {\pi }{2}\right )^2}dx\)

\(\Big \downarrow \) 4360

\(\displaystyle \int -\left (\csc ^2(c+d x) \sec (c+d x) (a (-\cos (c+d x))-a)\right )dx\)

\(\Big \downarrow \) 25

\(\displaystyle -\int -\left ((\cos (c+d x) a+a) \csc ^2(c+d x) \sec (c+d x)\right )dx\)

\(\Big \downarrow \) 25

\(\displaystyle \int \csc ^2(c+d x) \sec (c+d x) (a \cos (c+d x)+a)dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int -\frac {a-a \sin \left (c+d x-\frac {\pi }{2}\right )}{\sin \left (c+d x-\frac {\pi }{2}\right ) \cos \left (c+d x-\frac {\pi }{2}\right )^2}dx\)

\(\Big \downarrow \) 25

\(\displaystyle -\int \frac {a-a \sin \left (\frac {1}{2} (2 c-\pi )+d x\right )}{\cos \left (\frac {1}{2} (2 c-\pi )+d x\right )^2 \sin \left (\frac {1}{2} (2 c-\pi )+d x\right )}dx\)

\(\Big \downarrow \) 3317

\(\displaystyle a \int \csc ^2(c+d x)dx-a \int -\csc ^2(c+d x) \sec (c+d x)dx\)

\(\Big \downarrow \) 25

\(\displaystyle a \int \csc ^2(c+d x)dx+a \int \csc ^2(c+d x) \sec (c+d x)dx\)

\(\Big \downarrow \) 3042

\(\displaystyle a \int \csc (c+d x)^2dx+a \int \csc (c+d x)^2 \sec (c+d x)dx\)

\(\Big \downarrow \) 3101

\(\displaystyle a \int \csc (c+d x)^2dx-\frac {a \int -\frac {\csc ^2(c+d x)}{1-\csc ^2(c+d x)}d\csc (c+d x)}{d}\)

\(\Big \downarrow \) 25

\(\displaystyle \frac {a \int \frac {\csc ^2(c+d x)}{1-\csc ^2(c+d x)}d\csc (c+d x)}{d}+a \int \csc (c+d x)^2dx\)

\(\Big \downarrow \) 262

\(\displaystyle a \int \csc (c+d x)^2dx-\frac {a \left (\csc (c+d x)-\int \frac {1}{1-\csc ^2(c+d x)}d\csc (c+d x)\right )}{d}\)

\(\Big \downarrow \) 219

\(\displaystyle a \int \csc (c+d x)^2dx-\frac {a (\csc (c+d x)-\text {arctanh}(\csc (c+d x)))}{d}\)

\(\Big \downarrow \) 4254

\(\displaystyle -\frac {a \int 1d\cot (c+d x)}{d}-\frac {a (\csc (c+d x)-\text {arctanh}(\csc (c+d x)))}{d}\)

\(\Big \downarrow \) 24

\(\displaystyle -\frac {a (\csc (c+d x)-\text {arctanh}(\csc (c+d x)))}{d}-\frac {a \cot (c+d x)}{d}\)

input
Int[Csc[c + d*x]^2*(a + a*Sec[c + d*x]),x]
 
output
-((a*Cot[c + d*x])/d) - (a*(-ArcTanh[Csc[c + d*x]] + Csc[c + d*x]))/d
 

3.1.14.3.1 Defintions of rubi rules used

rule 24
Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]
 

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

rule 219
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))* 
ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (Gt 
Q[a, 0] || LtQ[b, 0])
 

rule 262
Int[((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^2)^(p_), x_Symbol] :> Simp[c*(c*x) 
^(m - 1)*((a + b*x^2)^(p + 1)/(b*(m + 2*p + 1))), x] - Simp[a*c^2*((m - 1)/ 
(b*(m + 2*p + 1)))   Int[(c*x)^(m - 2)*(a + b*x^2)^p, x], x] /; FreeQ[{a, b 
, c, p}, x] && GtQ[m, 2 - 1] && NeQ[m + 2*p + 1, 0] && IntBinomialQ[a, b, c 
, 2, m, p, x]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 3101
Int[(csc[(e_.) + (f_.)*(x_)]*(a_.))^(m_)*sec[(e_.) + (f_.)*(x_)]^(n_.), x_S 
ymbol] :> Simp[-(f*a^n)^(-1)   Subst[Int[x^(m + n - 1)/(-1 + x^2/a^2)^((n + 
 1)/2), x], x, a*Csc[e + f*x]], x] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n 
 + 1)/2] &&  !(IntegerQ[(m + 1)/2] && LtQ[0, m, n])
 

rule 3317
Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((d_.)*sin[(e_.) + (f_.)*(x_)])^(n 
_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[a   Int[(g*Co 
s[e + f*x])^p*(d*Sin[e + f*x])^n, x], x] + Simp[b/d   Int[(g*Cos[e + f*x])^ 
p*(d*Sin[e + f*x])^(n + 1), x], x] /; FreeQ[{a, b, d, e, f, g, n, p}, x]
 

rule 4254
Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Simp[-d^(-1)   Subst[Int[Exp 
andIntegrand[(1 + x^2)^(n/2 - 1), x], x], x, Cot[c + d*x]], x] /; FreeQ[{c, 
 d}, x] && IGtQ[n/2, 0]
 

rule 4360
Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + 
(a_))^(m_.), x_Symbol] :> Int[(g*Cos[e + f*x])^p*((b + a*Sin[e + f*x])^m/Si 
n[e + f*x]^m), x] /; FreeQ[{a, b, e, f, g, p}, x] && IntegerQ[m]
 
3.1.14.4 Maple [A] (verified)

Time = 0.75 (sec) , antiderivative size = 42, normalized size of antiderivative = 1.14

method result size
derivativedivides \(\frac {a \left (-\frac {1}{\sin \left (d x +c \right )}+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )-a \cot \left (d x +c \right )}{d}\) \(42\)
default \(\frac {a \left (-\frac {1}{\sin \left (d x +c \right )}+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )-a \cot \left (d x +c \right )}{d}\) \(42\)
norman \(-\frac {a}{d \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}+\frac {a \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d}-\frac {a \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{d}\) \(54\)
risch \(-\frac {2 i a}{d \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}-\frac {a \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{d}+\frac {a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{d}\) \(59\)
parallelrisch \(\frac {a \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )-\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )-1\right )}{d \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}\) \(64\)

input
int(csc(d*x+c)^2*(a+a*sec(d*x+c)),x,method=_RETURNVERBOSE)
 
output
1/d*(a*(-1/sin(d*x+c)+ln(sec(d*x+c)+tan(d*x+c)))-a*cot(d*x+c))
 
3.1.14.5 Fricas [A] (verification not implemented)

Time = 0.28 (sec) , antiderivative size = 63, normalized size of antiderivative = 1.70 \[ \int \csc ^2(c+d x) (a+a \sec (c+d x)) \, dx=\frac {a \log \left (\sin \left (d x + c\right ) + 1\right ) \sin \left (d x + c\right ) - a \log \left (-\sin \left (d x + c\right ) + 1\right ) \sin \left (d x + c\right ) - 2 \, a \cos \left (d x + c\right ) - 2 \, a}{2 \, d \sin \left (d x + c\right )} \]

input
integrate(csc(d*x+c)^2*(a+a*sec(d*x+c)),x, algorithm="fricas")
 
output
1/2*(a*log(sin(d*x + c) + 1)*sin(d*x + c) - a*log(-sin(d*x + c) + 1)*sin(d 
*x + c) - 2*a*cos(d*x + c) - 2*a)/(d*sin(d*x + c))
 
3.1.14.6 Sympy [F]

\[ \int \csc ^2(c+d x) (a+a \sec (c+d x)) \, dx=a \left (\int \csc ^{2}{\left (c + d x \right )} \sec {\left (c + d x \right )}\, dx + \int \csc ^{2}{\left (c + d x \right )}\, dx\right ) \]

input
integrate(csc(d*x+c)**2*(a+a*sec(d*x+c)),x)
 
output
a*(Integral(csc(c + d*x)**2*sec(c + d*x), x) + Integral(csc(c + d*x)**2, x 
))
 
3.1.14.7 Maxima [A] (verification not implemented)

Time = 0.20 (sec) , antiderivative size = 50, normalized size of antiderivative = 1.35 \[ \int \csc ^2(c+d x) (a+a \sec (c+d x)) \, dx=-\frac {a {\left (\frac {2}{\sin \left (d x + c\right )} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + \frac {2 \, a}{\tan \left (d x + c\right )}}{2 \, d} \]

input
integrate(csc(d*x+c)^2*(a+a*sec(d*x+c)),x, algorithm="maxima")
 
output
-1/2*(a*(2/sin(d*x + c) - log(sin(d*x + c) + 1) + log(sin(d*x + c) - 1)) + 
 2*a/tan(d*x + c))/d
 
3.1.14.8 Giac [A] (verification not implemented)

Time = 0.31 (sec) , antiderivative size = 50, normalized size of antiderivative = 1.35 \[ \int \csc ^2(c+d x) (a+a \sec (c+d x)) \, dx=\frac {a \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - a \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {a}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}}{d} \]

input
integrate(csc(d*x+c)^2*(a+a*sec(d*x+c)),x, algorithm="giac")
 
output
(a*log(abs(tan(1/2*d*x + 1/2*c) + 1)) - a*log(abs(tan(1/2*d*x + 1/2*c) - 1 
)) - a/tan(1/2*d*x + 1/2*c))/d
 
3.1.14.9 Mupad [B] (verification not implemented)

Time = 13.69 (sec) , antiderivative size = 29, normalized size of antiderivative = 0.78 \[ \int \csc ^2(c+d x) (a+a \sec (c+d x)) \, dx=\frac {a\,\left (2\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )-\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d} \]

input
int((a + a/cos(c + d*x))/sin(c + d*x)^2,x)
 
output
(a*(2*atanh(tan(c/2 + (d*x)/2)) - cot(c/2 + (d*x)/2)))/d